package com.sc.syllabus.money;

import android.os.Parcel;
import android.os.Parcelable;

import com.litesuits.orm.db.annotation.Column;
import com.srain.utils.db.BaseTable;

/**
 * Created by liushuanglong on 2017/9/13.
 * <p>
 * 金钱类
 */
public class MoneyInfo extends BaseTable implements Parcelable {
    @Column("title")
    private String title; //

    @Column("content")
    private String content; //

    @Column("amount")
    private double amount; // 资金总额

    @Column("interest")
    private double interest; // 利率

    @Column("date_jk")
    private long date_jk; // 借款时间

    @Column("date_yqhk")
    private long date_yqhk; // 预计还款时间

    @Column("type")
    private int type; // 类型 0借入，1借出

    public MoneyInfo() {
        super();
    }

    protected MoneyInfo(Parcel in) {
        _id = in.readLong();
        title = in.readString();
        content = in.readString();
        amount = in.readDouble();
        interest = in.readDouble();
        date_jk = in.readLong();
        date_yqhk = in.readLong();
        type = in.readInt();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(_id);
        dest.writeString(title);
        dest.writeString(content);
        dest.writeDouble(amount);
        dest.writeDouble(interest);
        dest.writeLong(date_jk);
        dest.writeLong(date_yqhk);
        dest.writeInt(type);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<MoneyInfo> CREATOR = new Creator<MoneyInfo>() {
        @Override
        public MoneyInfo createFromParcel(Parcel in) {
            return new MoneyInfo(in);
        }

        @Override
        public MoneyInfo[] newArray(int size) {
            return new MoneyInfo[size];
        }
    };

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public double getAmount() {
        return amount;
    }

    public void setAmount(double amount) {
        this.amount = amount;
    }

    public double getInterest() {
        return interest;
    }

    public void setInterest(double interest) {
        this.interest = interest;
    }

    public long getDate_jk() {
        return date_jk;
    }

    public void setDate_jk(long date_jk) {
        this.date_jk = date_jk;
    }

    public long getDate_yqhk() {
        return date_yqhk;
    }

    public void setDate_yqhk(long date_yqhk) {
        this.date_yqhk = date_yqhk;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }
}
